﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using TR.AppService.AppService.Bs_Supply;
using TR.AppService.Dto;
using TR.AppService.Dto.SupplyDto;
using TR.Domain.Entity;

namespace TR.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class bs_SupplyController : ControllerBase
    {
        public readonly Ibs_SupplyAppService IbsSupplyAppService;

        public bs_SupplyController(Ibs_SupplyAppService IbsSupplyAppService)
        {
            this.IbsSupplyAppService = IbsSupplyAppService;
        }
        //分页条件查询
        [HttpGet]
        public async Task<DtoFenYe<bs_Supply>> SupplyTjSelectAsync(int mys, int dqy,[FromQuery] SupplyFenyeTjDto bs)
        {
            return await IbsSupplyAppService.FenYeSupply(mys, dqy, bs);
        }

        //添加
        [HttpPost]
        public async Task<bool> SupplyAddAsync([FromQuery] SupplyDtoAdd supplyDto)
        {
            return await IbsSupplyAppService.SupplyAdd(supplyDto);
        }

        [HttpPost]
        public async Task<bool> FinanceAddAsync([FromQuery] FinanceAdd financeDto)
        {
            return await IbsSupplyAppService.SupplyAddFinance(financeDto);
        }
    }
}
